﻿using System;
using System.Collections.Generic;
using System.IO;


namespace Infrastructure
{
    public class HtmlLogger:Log
    {
        public override void WriteLog(String fileName)
        {
            try
            {
                var file = new StreamWriter(fileName);
                file.WriteLine("<html><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\"/></head><body><table>");
                foreach (string t in Record)
                {
                    file.WriteLine(string.Format("<tr><td>{0}</td></tr>", t));
                }
                file.WriteLine("</table></body></html>");
                file.Close();
            }
            catch (Exception)
            {
                throw new FileNotFoundException();
            }
        }
    }
}
